
<?php
if (!empty($errors)) {
    echo '<div class="alert alert-danger">';
    foreach($errors as $error) {
        echo "<p>$error</p>";
    }
    echo '</div>';
}    
?>

<form class="form-horizontal" action="admin.php?r=categories/update&id=<?php echo $id; ?>" enctype="multipart/form-data" method="post">
    <div class="form-group">
        <label class="control-label col-sm-2">Danh mục</label>
        <div class="col-sm-10">
            <input name="name" type="text" class="form-control" value="<?php if(isset($category['name'])) echo $category['name']; ?>" placeholder="Tên danh mục"/>
        </div>        
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">Keyword</label>
        <div class="col-sm-10">
            <textarea name="keywords" class="form-control" placeholder="SEO Keywords"><?php if(isset($category['keywords'])) echo $category['keywords']; ?></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">Description</label>
        <div class="col-sm-10">
            <textarea name="description" class="form-control" placeholder="SEO Description"><?php if(isset($category['description'])) echo $category['description']; ?></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-2">Vị trí</label>
        <div class="col-sm-10">
            <input name="position" type="text" class="form-control" value="<?php if(isset($category['position'])) echo $category['position']; ?>" placeholder="Vị trí"/>
        </div>        
    </div>
    <div class="form-group">
        <div class="col-lg-10 col-lg-offset-2">
            <input type="submit" class="btn btn-primary" value="Cập nhật" />
            <a  class="btn btn-warning" href="admin.php?r=categories/index">Trở về</a>
        </div>
        
    </div>
</form>
